using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._BusinessAnalystTools._Analysis
{
    /// <summary>
    /// <para>Find Nearby Locations</para>
    /// <para>Identifies locations closest to the input features based on a selected distance type. The number of points in the output is defined by limiting the count or percentage of location points to return or by limiting the distance from the input points.</para>
    /// <para>根据所选距离类型识别最接近输入要素的位置。输出中的点数是通过限制要返回的位置点的计数或百分比或限制与输入点的距离来定义的。</para>
    /// </summary>    
    [DisplayName("Find Nearby Locations")]
    public class FindNearbyLocations : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FindNearbyLocations()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The point layer to be measured to or from Location Points.</para>
        /// <para>要测量到位置点或从位置点测量的点图层。</para>
        /// </param>
        /// <param name="_id_field">
        /// <para>ID Field</para>
        /// <para>A field containing unique identifiers for each input feature.</para>
        /// <para>包含每个输入要素的唯一标识符的字段。</para>
        /// </param>
        /// <param name="_in_location_points">
        /// <para>Location Points</para>
        /// <para>The layer that will be used to generate the output with distance and direction attributes to or from Input Features.</para>
        /// <para>将用于生成输出的图层，该输出具有与输入要素之间的距离和方向属性。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output location point features.</para>
        /// <para>输出定位点要素。</para>
        /// </param>
        public FindNearbyLocations(object _in_features, object _id_field, object _in_location_points, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._id_field = _id_field;
            this._in_location_points = _in_location_points;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Business Analyst Tools";

        public override string ToolName => "Find Nearby Locations";

        public override string CallName => "ba.FindNearbyLocations";

        public override List<string> AcceptEnvironments => ["baDataSource", "baNetworkSource", "workspace"];

        public override object[] ParameterInfo => [_in_features, _id_field, _in_location_points, _out_feature_class, _distance_type, _units, _distance_limit, _number_limit, _percent_limit, _create_report.GetGPValue(), _report_title, _report_folder, _report_format, _report_fields, _travel_direction.GetGPValue(), _time_of_day, _time_zone.GetGPValue(), _search_tolerance, _output_report];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The point layer to be measured to or from Location Points.</para>
        /// <para>要测量到位置点或从位置点测量的点图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>ID Field</para>
        /// <para>A field containing unique identifiers for each input feature.</para>
        /// <para>包含每个输入要素的唯一标识符的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _id_field { get; set; }


        /// <summary>
        /// <para>Location Points</para>
        /// <para>The layer that will be used to generate the output with distance and direction attributes to or from Input Features.</para>
        /// <para>将用于生成输出的图层，该输出具有与输入要素之间的距离和方向属性。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Location Points")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_location_points { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output location point features.</para>
        /// <para>输出定位点要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Distance Type</para>
        /// <para>The calculated distance based on the method of travel. Straight Line is the default value.</para>
        /// <para>根据行驶方法计算的距离。直线是默认值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _distance_type { get; set; } = null;


        /// <summary>
        /// <para>Distance Units</para>
        /// <para>The measurement units, in distance or time, that will be used when calculating nearby locations.</para>
        /// <para>计算附近位置时将使用的测量单位（以距离或时间为单位）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Units")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _units { get; set; } = null;


        /// <summary>
        /// <para>Distance Limit</para>
        /// <para>The analysis extent measured in distance or time.</para>
        /// <para>以距离或时间测量的分析范围。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Limit")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _distance_limit { get; set; } = null;


        /// <summary>
        /// <para>Number of Locations Limit</para>
        /// <para>The numeric limit of the Location Points value.</para>
        /// <para>“位置点”值的数值限制。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Locations Limit")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _number_limit { get; set; } = null;


        /// <summary>
        /// <para>Percentage of Locations Limit</para>
        /// <para>The closest points, as a percentage of the points of the Location Points value.</para>
        /// <para>最接近的点，以“位置点”值的点的百分比表示。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Percentage of Locations Limit")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _percent_limit { get; set; } = null;


        /// <summary>
        /// <para>Create Report</para>
        /// <para><xdoc>
        ///   <para>Specifies whether an output report will be created.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—A report will be created.</bullet_item><para/>
        ///     <bullet_item>Unchecked—A report will not be created. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否创建输出报表。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将创建报告。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会创建报告。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Create Report")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _create_report_value _create_report { get; set; } = _create_report_value._false;

        public enum _create_report_value
        {
            /// <summary>
            /// <para>CREATE_REPORT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CREATE_REPORT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_CREATE_REPORT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_CREATE_REPORT")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Report Title</para>
        /// <para>The title of the output report.</para>
        /// <para>输出报告的标题。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Report Title")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _report_title { get; set; } = null;


        /// <summary>
        /// <para>Output Report Folder</para>
        /// <para>The directory that will contain the output report.</para>
        /// <para>将包含输出报表的目录。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Report Folder")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _report_folder { get; set; } = null;


        /// <summary>
        /// <para>Report Output Formats</para>
        /// <para>The output report formats. The default value is InfographicHTML. Additional available formats are PDF, XLSX, S.XLSX, HTML, S.XML, ZIP, CVS, PAGX, and InfographicPDF.</para>
        /// <para>输出报告格式。默认值为 InfographicHTML。其他可用格式包括 PDF、XLSX、S.XLSX、HTML、S.XML、ZIP、CVS、PAGX 和 InfographicPDF。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Report Output Formats")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _report_format { get; set; } = null;


        /// <summary>
        /// <para>Report Fields</para>
        /// <para>The additional fields that will be added to the report.</para>
        /// <para>将添加到报表中的其他字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Report Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _report_fields { get; set; } = null;


        /// <summary>
        /// <para>Travel Direction</para>
        /// <para><xdoc>
        ///   <para>Specifies whether travel times or distances will be measured from location points to input features or from input features to location points.</para>
        ///   <bulletList>
        ///     <bullet_item>Toward Input Features—The direction of travel will be from location points to input features. This is the default.</bullet_item><para/>
        ///     <bullet_item>Away from Input Features—The direction of travel will be from input features to location points.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是从位置点到输入要素还是从输入要素到位置点测量行驶时间或距离。</para>
        ///   <bulletList>
        ///     <bullet_item>朝向输入要素 - 行进方向将从定位点到输入要素。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>远离输入要素—行进方向将从输入要素到定位点。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Travel Direction")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _travel_direction_value _travel_direction { get; set; } = _travel_direction_value._TOWARD_STORES;

        public enum _travel_direction_value
        {
            /// <summary>
            /// <para>Toward Input Features</para>
            /// <para>Toward Input Features—The direction of travel will be from location points to input features. This is the default.</para>
            /// <para>朝向输入要素 - 行进方向将从定位点到输入要素。这是默认设置。</para>
            /// </summary>
            [Description("Toward Input Features")]
            [GPEnumValue("TOWARD_STORES")]
            _TOWARD_STORES,

            /// <summary>
            /// <para>Away from Input Features</para>
            /// <para>Away from Input Features—The direction of travel will be from input features to location points.</para>
            /// <para>远离输入要素—行进方向将从输入要素到定位点。</para>
            /// </summary>
            [Description("Away from Input Features")]
            [GPEnumValue("AWAY_FROM_STORES")]
            _AWAY_FROM_STORES,

        }

        /// <summary>
        /// <para>Time of Day</para>
        /// <para>The time at which travel begins.</para>
        /// <para>旅行开始的时间。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time of Day")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_of_day { get; set; } = null;


        /// <summary>
        /// <para>Time Zone</para>
        /// <para><xdoc>
        ///   <para>Specifies the time zone that will be used for the Time of Day parameter.</para>
        ///   <bulletList>
        ///     <bullet_item>UTC—Coordinated universal time (UTC) will be used. Choose this option if you want the best location for a specific time, such as now, but aren't certain of the time zone in which the Location Points value will be located.</bullet_item><para/>
        ///     <bullet_item>Local time at locations—The time zone in which the Location Points value will be located will be used. If the travel direction is input features to location points, this is the time zone of the input features. If the travel direction is location points to input features, this is the time zone of the location points. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于“时间”参数的时区。</para>
        ///   <bulletList>
        ///     <bullet_item>UTC—将使用协调世界时 （UTC）。如果您想要特定时间（例如现在）的最佳位置，但不确定“位置点”值所在的时区，请选择此选项。</bullet_item><para/>
        ///     <bullet_item>地点的当地时间 - 将使用位置点值所在的时区。如果行进方向是到定位点的输入要素，则为输入要素的时区。如果行进方向为输入要素的位置点，则为位置点的时区。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Zone")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _time_zone_value _time_zone { get; set; } = _time_zone_value._TIME_ZONE_AT_LOCATION;

        public enum _time_zone_value
        {
            /// <summary>
            /// <para>UTC</para>
            /// <para>UTC—Coordinated universal time (UTC) will be used. Choose this option if you want the best location for a specific time, such as now, but aren't certain of the time zone in which the Location Points value will be located.</para>
            /// <para>UTC—将使用协调世界时 （UTC）。如果您想要特定时间（例如现在）的最佳位置，但不确定“位置点”值所在的时区，请选择此选项。</para>
            /// </summary>
            [Description("UTC")]
            [GPEnumValue("UTC")]
            _UTC,

            /// <summary>
            /// <para>Local time at locations</para>
            /// <para>Local time at locations—The time zone in which the Location Points value will be located will be used. If the travel direction is input features to location points, this is the time zone of the input features. If the travel direction is location points to input features, this is the time zone of the location points. This is the default.</para>
            /// <para>地点的当地时间 - 将使用位置点值所在的时区。如果行进方向是到定位点的输入要素，则为输入要素的时区。如果行进方向为输入要素的位置点，则为位置点的时区。这是默认设置。</para>
            /// </summary>
            [Description("Local time at locations")]
            [GPEnumValue("TIME_ZONE_AT_LOCATION")]
            _TIME_ZONE_AT_LOCATION,

        }

        /// <summary>
        /// <para>Search Tolerance</para>
        /// <para>The maximum distance that input points can be from the network. Points located beyond the search tolerance will be excluded from processing.</para>
        /// <para>输入点与网络的最大距离。超出搜索容差范围的点将被排除在处理范围之外。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _search_tolerance { get; set; } = null;


        /// <summary>
        /// <para>Output Report</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Report")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public List<object> _output_report { get; set; }


        public FindNearbyLocations SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}